package Atm01;

import javax.swing.*;
import java.awt.*;

/**
 * GUI版本的ATM窗口
 */
public class ATMFrame extends JFrame {
    private Image bgImage = new ImageIcon("images/background.jpg").getImage();

//    private LoginPanel loginPanel = new LoginPanel();
//    private MenuPanel menuPanel = new MenuPanel();
//    private SavePanel savePanel=new SavePanel();
//    private GetPanel getPanel=new GetPanel();
//     private SearchPanel searchPanel=new SearchPanel();
//       private ChangePwdPanel changePwdPanel=new ChangePwdPanel();

    private TransferPanel  transferPanel=new TransferPanel();

           private CardLayout cardLayout = new CardLayout();
    public ATMFrame(){
        this.setContentPane(new JPanel(){
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.drawImage(bgImage,0,0,this);
            }
        });
        this.setLayout(cardLayout);

//        this.add("login",loginPanel);
//        this.add("menu",menuPanel);
//        this.add("save",savePanel);
//        this.add("get",getPanel);
//        this.add("searchPanel",searchPanel);
//        this.add("changPwd",changePwdPanel);
//        this.add("transferPanel",transferPanel);


        this.setSize(1024,768);
        this.setTitle("ATM");
        this.setResizable(false);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new ATMFrame();
    }
}
